package com.modules.version.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.common.response.ResponseVO;
import com.common.utils.Query;
import com.common.utils.R;
import com.modules.version.entity.Version;
import com.modules.version.mapper.VersionMapper;
import com.modules.version.service.IVersionService;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service("versionService")
public class VersionServiceImpl extends ServiceImpl<VersionMapper, Version> implements IVersionService {

    @Override
    public R getPageList(Map<String, Object> params) {

        IPage<Version> page = new Query<Version>().getPage(params);
        page = this.page(page, new QueryWrapper<Version>().lambda().orderByDesc(Version::getCreateTime));
        return R.ok().put("data",page);
    }
}
